package com.atguigu.jxc.dao;

import com.atguigu.jxc.entity.Goods;
import com.atguigu.jxc.entity.GoodsType;
import com.atguigu.jxc.entity.Unit;
import com.github.pagehelper.PageInfo;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * @description 商品信息
 */
public interface GoodsDao {

    String getMaxCode();

    List<Goods> selectByPage(@Param("page") Integer page,@Param("rows") Integer rows,@Param("codeOrName") String codeOrName,@Param("goodsTypeId") Integer goodsTypeId);

    Long selectPageCount();

    List<GoodsType> selectGoodsType();

    List<Goods> selectGoodsByPage(String goodsName, Integer goodsTypeId);

    List<Unit> getGoodsUnit();

    void updateGoods(Goods goods, Integer goodsId);

    void insertGoods(Goods goods);

    Goods selectGoodsById(Integer goodsId);

    void deleteGoodsInfoById(Integer goodsId);

    List<Goods> selectNoInventoryByPage(@Param("nameOrCode") String nameOrCode);

    List<Goods> selectHasInventoryByPage(@Param("nameOrCode") String nameOrCode);

    void updateGoodsStock(@Param("goodsId")Integer goodsId,@Param("inventoryQuantity") Integer inventoryQuantity,@Param("purchasingPrice") double purchasingPrice);

    void deleteGoodsStock(@Param("goodsId")Integer goodsId);

    List<Goods> selectGoodsListAlarm();

}
